package com.jlpay.openapi.demo.ledger.merchconf;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.MerchRevQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.MerchRevQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class MerchRevQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MerchRevQueryService.class);

    public static void main(String[] args) {
        MerchRevQueryRequest merchRevQueryRequest = buildMerchRevQueryRequest();
        MerchRevQueryResponse merchRevQueryResponse = JlpayOpenApiService.openMerchService()
                .post(merchRevQueryRequest, MerchRevQueryResponse.class);
        LOGGER.info("分账配置入账方信息查询响应:{}", JsonUtils.toString(merchRevQueryResponse));
    }

    private static MerchRevQueryRequest buildMerchRevQueryRequest() {
        MerchRevQueryRequest merchRevQueryRequest = new MerchRevQueryRequest();
        merchRevQueryRequest.setOrgCode("50720711");
        merchRevQueryRequest.setMchId("849581183510017");
        return merchRevQueryRequest;
    }
}
